<?php namespace App;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;

/**
 * App\Org
 *
 * @property integer $id
 * @property integer $fac_id
 * @property string $org_name
 * @property string $org_desc
 * @property string $province
 * @property string $city
 * @property string $area
 * @property string $experience
 * @property integer $has_invoice
 * @property integer $team_num
 * @property string $solution
 * @property string $other_service
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereFacId($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereOrgName($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereOrgDesc($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereProvince($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereCity($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereArea($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereExperience($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereHasInvoice($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereTeamNum($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereSolution($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereOtherService($value)
 * @property-read \App\Facilitator $fac
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Fields[] $fields
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Skills[] $skills
 * @property string $deleted_at
 * @property \Carbon\Carbon $created_at
 * @property \Carbon\Carbon $updated_at
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereDeletedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereCreatedAt($value)
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereUpdatedAt($value)
 * @property integer $org_type
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereOrgType($value)
 * @property integer $img_logo_id
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereImgLogoId($value)
 * @property-read \App\Images $photo
 * @property string $people_desc
 * @method static \Illuminate\Database\Query\Builder|\App\Org wherePeopleDesc($value)
 * @property-read \Illuminate\Database\Eloquent\Collection|\App\Example[] $exam
 * @property integer $state
 * @method static \Illuminate\Database\Query\Builder|\App\Org whereState($value)
 */
class Org extends Model
{
    protected $table = 'organization' ;
    use SoftDeletes;

    public function fac(){
        return $this->belongsTo('App\Facilitator','fac_id');
    }

    public function fields(){
        return $this->belongsToMany('App\Fields','org_x_field','org_id','field_id');
    }

    public function skills(){
        return $this->belongsToMany('App\Skills','org_x_skill','org_id','skill_id');
    }

    public function photo(){
        return $this->belongsTo('App\Images','img_logo_id');
    }

    public function exam(){
        return $this->hasMany('App\Example','org_id');
    }
}